import { ElementRef, OnInit, Renderer2,Input,Directive } from '@angular/core';

@Directive({
    selector: '[el-class]',
})

export  class ElClassDirective implements OnInit {
    private el:any;
    private renderer:any;
    @Input() classNames: string = '';
    constructor(el: ElementRef, renderer: Renderer2){
        this.el = el;
        this.renderer = renderer;
    };
    ngOnInit(): void {
        this.renderer.addClass(this.el.nativeElement, this.classNames);
    }
}